package com.kevin.springcloud.controller;

import com.kevin.springcloud.entities.CommonResult;
import com.kevin.springcloud.entities.Payment;
import com.kevin.springcloud.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xijinlong
 * @date 2020-08-26 17:59
 */
@Controller
@RestController
public class OrderController {


    @Autowired
    PaymentService paymentService;

    @GetMapping("/feign/consumer/payment/get/{id}")
    public CommonResult<Payment> getPayment(@PathVariable("id") Long id) {
        return paymentService.getPaymentById(id);
    }

//
//    @GetMapping("/feign/consumer/payment/get/{id}")
//    public CommonResult<Payment> getPayment(@PathVariable("id") Long id) {
//        return new CommonResult<Payment>(400,null);
//    }


}
